<!--
  Generated template for the Readoffice page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

	<ion-navbar>
		<ion-title>收文传阅</ion-title>
		<ion-buttons end>
			<button ion-button icon-only (click)="dosearch()">
				<ion-icon name="search"></ion-icon>
			</button>
		</ion-buttons>
	</ion-navbar>
	<ion-toolbar no-border-top class="white">
		<ion-segment [(ngModel)]="selectIndex" (ionChange)="segmentChanged($event)">
			<ion-segment-button value="0">
				待阅
			</ion-segment-button>
			<ion-segment-button value="1">
				已阅
			</ion-segment-button>
		</ion-segment>
	</ion-toolbar>
</ion-header>


<ion-content>
	<ion-refresher (ionRefresh)="doRefresh($event)">
		<ion-refresher-content></ion-refresher-content>
	</ion-refresher>
	<div [ngSwitch]="selectIndex">
		<div *ngSwitchCase="0">
			<ion-list class="search">
				<ion-item *ngFor="let item of listItems1" tappable (click)="dodetail(item)">
					<div>文件标题：{{item.title}}</div>
					<div>收发文号：{{item.fileNo}}</div>
					<div>发文单位：{{item.dispatchUnit}} 登记人：{{item.registrant.name}} </div>
					<div>发文日期：{{item.fileDate}}</div>
					<i class="right-icon iconfont icon-xiangqing" item-end></i>
				</ion-item>
			</ion-list>
			<div class="nodata" *ngIf="listItems1.length == 0">找不到您要的数据哦^</div>
		</div>
		<div *ngSwitchCase="1">
			<ion-list class="search">
				<ion-item *ngFor="let item of listItems2" tappable (click)="dodetail(item)">
					<div>文件标题：{{item.title}}</div>
					<div>收发文号：{{item.fileNo}}</div>
					<div>发文单位：{{item.dispatchUnit}} 登记人：{{item.registrant.name}} </div>
					<div>发文日期：{{item.fileDate}}</div>
					<i class="right-icon iconfont icon-xiangqing" item-end></i>
				</ion-item>
			</ion-list>
			<div class="nodata" *ngIf="listItems2.length == 0">找不到您要的数据哦^</div>
		</div>
	</div>
	<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
		<ion-infinite-scroll-content></ion-infinite-scroll-content>
	</ion-infinite-scroll>
</ion-content>